package com.train.chatspring.controller;

import javax.websocket.OnMessage;
import javax.websocket.Session;
import javax.websocket.server.PathParam;
import javax.websocket.server.ServerEndpoint;

@ServerEndpoint("/{username}/queue/messages")
public class MessageReceiverEndpoint {

    @OnMessage
    public void handleMessage(String message, Session session) {
        // 这里可以处理接收到的消息
        System.out.println("Received message for user: " + message);
    }
}